// import Uts from '@module/Uts'

import Filter from "@module/Filter";

export default function ConfirmPriceModal(props) {

    const {closeModal,clickCancel,clickOk,bidInfo,formData}=props;
    return (
        <div className="zen_fs-14">
            <div className="zen_t-c zen_m-b-20 zen_m-l-30 bid-inputbid-word-break">
                <RowOne bidInfo={bidInfo} formData={formData}/>
                <RowTwo bidInfo={bidInfo} formData={formData}/>
                <RowThree/>
                <div className="zenModal-footer">
                    <div>
                        <div
                            onClick={clickOk}
                            className="h-button-button h-button-primary h-modal-conBtn " type="button">
                            确认报价
                        </div>
                        <div
                            onClick={clickCancel}
                            className="h-button-button h-button-origin h-button-sub h-modal-canBtn " role="button"
                             type="button">
                            返回
                        </div>
                    </div>
                </div>
            </div>
        </div>
    )
}


function RowOne(props) {
    const {bidInfo,formData}=props
    // console.log(bidInfo)
    const {
        name,attachmentUrl, bidPrice,
        brandName,
        code,
        count,
        deliveryTime,
        fileId,
        fileName,
        id,
        productPrice,
        remark,
        sn,
        spec,
        price,
        unit,
        brand
    }=bidInfo||{};
    let _price=productPrice?productPrice:price

    return(
        <div className=" zen_m-t-10 zen_646464">
            <p className="zen_0093EB zen_fs-18 zen_f-left zen_m-l-50 zen_m-b-8">商品信息</p>
            <div className="zen_m-l-20 zen_flex zen_t-l zen_w-p100">
                <div className="zen_w-p50 zen_m-r-50">
                    <div className="zen_l-h-30 zen_m-l-44 zen_flex">
                        <span className="bid-inputbid-min-width">商品名称</span>
                        <div className="zen_m-l-20 zen_646464 bid-inputbid-conf-name">{name}</div>
                    </div>
                    <div className="zen_l-h-30 zen_m-l-44">
                        <span>商品编码</span>
                        <span className="zen_m-l-20 zen_646464 ">{code}</span>
                    </div>
                    <div className="zen_l-h-30 zen_m-l-44">
                        <span>商品价格</span>
                        <span className="zen_m-l-20 zen_646464 ">{Filter.float(_price,2)}</span>
                    </div>
                </div>
                <div className="zen_w-p30">
                    <div className="zen_l-h-30 ">
                        <span>商品品牌</span>
                        <span className="zen_m-l-15 zen_646464 ">{brandName||brand||'无'}</span>
                    </div>
                    <div className="zen_l-h-30 ">
                        <span>商品单位</span>
                        <span className="zen_m-l-15 zen_646464 ">{unit||'无'}</span>
                    </div>
                </div>
            </div>
        </div>
    )
}


function RowTwo(props) {
    const {bidInfo,formData}=props;
    // console.log(bidInfo)
    const {
        name,attachmentUrl, bidPrice,
        brandName,
        code,
        count,
        deliveryTime,
        fileId,
        fileName,
        id,
        productPrice,
        remark,
        sn,
        spec,
        price,
        unit
    }=bidInfo||{};

    return(
        <div className="zen_m-t-15 zen_646464">
            <p className="zen_0093EB zen_fs-18 zen_f-left zen_m-l-50 zen_m-b-8">报价信息</p>
            <br/>
            <div className="zen_m-l-20 zen_t-l zen_w-p100">
                <div className="zen_flex zen_t-l zen_w-p100">
                    <div className="zen_l-h-24 zen_w-p50 zen_m-r-50">
                        <span className="zen_m-l-44">竞价数量</span>
                        <span className="zen_m-l-15 zen_646464 ">{formData.count}</span>
                    </div>
                    <div className="zen_l-h-30 ">
                        <span >发货天数</span>
                        <span className="zen_m-l-15 zen_646464 ">{formData.day}</span>
                    </div>
                </div>
                <div className="zen_t-l">
                    <div className="zen_l-h-30 zen_m-l-30">
                        <span>竞价总报价</span>
                        <span className="zen_m-l-10 zen_646464 ">{formData.price}</span>
                    </div>

                    <div className="zen_l-h-30 zen_m-l-44 zen_flex">
                        <span className="bid-inputbid-min-width2">我的优势</span>
                        <span className="zen_m-l-15 zen_646464 bid-inputbid-conf-name zen_m-r-80">{formData.remark||'无'}</span>
                    </div>
                    <div className="zen_l-h-24 bid-inputbid-navig-marleft">
                        <span>补充资料/应标方案</span>
                        {
                            formData.filePath?
                            <span className='zen_m-l-15 zen_0093EB ' >{formData.filePath}</span>
                                :
                            <span className="zen_m-l-15 zen_646464 ">{"无"}</span>
                        }

                    </div>

                </div>
            </div>

        </div>
    )
}



function RowThree() {
    return(
        <div className=" zen_m-t-15 zen_646464">
            <p className="zen_0093EB zen_fs-18 zen_f-left zen_m-l-50">特殊说明</p>
            <br/>
            <div className="zen_w-p100 zen_t-l zen_l-h-24 zen_f-left zen_p-r-50 bid-inputbid-big-pdleft ">
                <span>报价信息确认完整后，一旦竞标成功，请按照你所填写的报价信息执行，随意取消订单或违反承诺将被平台视作不诚信行为，将会受到平台的惩罚。</span>
            </div>

        </div>
    )
}